from django.db import models
from meiduo.utils.data_model import DataModel

from users.models import User


class QQAuth(DataModel):
    openid = models.CharField(max_length=80,db_index=True,verbose_name="openid")
    user = models.ForeignKey(User,on_delete=models.CASCADE,verbose_name="用户")

    class Meta:
        db_table = "tb_openid"
        verbose_name = "qq用户登陆数据"
        verbose_name_plural = verbose_name


class SinaAuth(DataModel):
    code = models.CharField(max_length=40,db_index=True,verbose_name="code")
    user = models.ForeignKey(User,on_delete=models.CASCADE,verbose_name="用户")

    class Meta:
        db_table = "tb_code"
        verbose_name = "sina用户登录数据"
        verbose_name_plural = verbose_name